package com.itheima.health.controller;

import com.itheima.health.common.MessageConst;
import com.itheima.health.entity.Result;
import com.itheima.health.pojo.CheckGroup;
import com.itheima.health.service.CheckGroupService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 检查组Controller
 */
@RestController
@RequestMapping("/checkgroup")
@Slf4j
public class CheckGroupController {
    @Autowired
    private CheckGroupService checkGroupService;
    @PostMapping("/add")
    public Result add(@RequestBody CheckGroup checkGroup){
        log.info("[检查组-新增]data:{}",checkGroup);
        checkGroupService.add(checkGroup);
        return new Result(true, MessageConst.ADD_CHECKGROUP_SUCCESS);
    }
}
